import javax.microedition.lcdui.*;
import java.util.*;
public class MyCanvas extends Canvas implements CommandListener, Runnable
{
private Command exit; 
private RectangleExample rectangleExample;
private int paintvalue1, newvalue1, paintvalue2, newvalue2, paintvalue3, newvalue3, paintvalue4, newvalue4, paintvalue5, newvalue5, paintvalue6, newvalue6, paintvalue7, newvalue7, paintvalue8, newvalue8, paintvalue9, newvalue9, paintvalue10, newvalue10;
private int paintvalue11, newvalue11, paintvalue12, newvalue12, paintvalue13, newvalue13, paintvalue14, newvalue14, paintvalue15, newvalue15, paintvalue16, newvalue16, paintvalue17, newvalue17, paintvalue18, newvalue18, paintvalue19, newvalue19, paintvalue20, newvalue20;
private int wp1, wp2, wp3, wp4, wp5, wp6, wp7, wp8, wp9, wp10, wp11, wp12, wp13, wp14, wp15, wp16, wp17, wp18, wp19, wp20;
private int i, j;
private Random rn;
private boolean stop;
public MyCanvas (RectangleExample rectangleExample)
{
setTitle("Music Visualization");
this.rectangleExample = rectangleExample;
stop = false;
rn = new Random();
i = 0;
paintvalue1 = rn.nextInt(getHeight());
newvalue1 = rn.nextInt(getHeight());
paintvalue2 = rn.nextInt(getHeight());
newvalue2 = rn.nextInt(getHeight());
paintvalue3 = rn.nextInt(getHeight());
newvalue3 = rn.nextInt(getHeight());
paintvalue4 = rn.nextInt(getHeight());
newvalue4 = rn.nextInt(getHeight());
paintvalue5 = rn.nextInt(getHeight());
newvalue5 = rn.nextInt(getHeight());
paintvalue6 = rn.nextInt(getHeight());
newvalue6 = rn.nextInt(getHeight());
paintvalue7 = rn.nextInt(getHeight());
newvalue7 = rn.nextInt(getHeight());
paintvalue8 = rn.nextInt(getHeight());
newvalue8 = rn.nextInt(getHeight());
paintvalue9 = rn.nextInt(getHeight());
newvalue9 = rn.nextInt(getHeight());
paintvalue10 = rn.nextInt(getHeight());
newvalue10 = rn.nextInt(getHeight());
paintvalue11 = rn.nextInt(getHeight());
newvalue11 = rn.nextInt(getHeight());
paintvalue12 = rn.nextInt(getHeight());
newvalue12 = rn.nextInt(getHeight());
paintvalue13 = rn.nextInt(getHeight());
newvalue13 = rn.nextInt(getHeight());
paintvalue14 = rn.nextInt(getHeight());
newvalue14 = rn.nextInt(getHeight());
paintvalue15 = rn.nextInt(getHeight());
newvalue15 = rn.nextInt(getHeight());
paintvalue16 = rn.nextInt(getHeight());
newvalue16 = rn.nextInt(getHeight());
paintvalue17 = rn.nextInt(getHeight());
newvalue17 = rn.nextInt(getHeight());
paintvalue18 = rn.nextInt(getHeight());
newvalue18 = rn.nextInt(getHeight());
paintvalue19 = rn.nextInt(getHeight());
newvalue19 = rn.nextInt(getHeight());
paintvalue20 = rn.nextInt(getHeight());
newvalue20 = rn.nextInt(getHeight());
exit = new Command("Thoat", Command.EXIT, 1);
addCommand(exit);
setCommandListener(this);
new Thread(this).start();
} 
protected void paint(Graphics graphics)
{
graphics.setColor(0,0,0);
graphics.fillRect(0, 0, getWidth(), getHeight());
j = 150;
for(i = getHeight(); i > paintvalue1; i -= 4){	
	graphics.setColor(j,j,255);
	if((i - paintvalue1) >= 4)		
		graphics.fillRect(4, i, 5, 3);
	else	
		graphics.fillRect(4, paintvalue1+3, 5, (i - paintvalue1));
	j -= 8;
	if(j<0)
		j = 0;
}
graphics.setColor(255,255,255);
graphics.fillRect(4, wp1, 5, 1);
j = 150;
for(i = getHeight(); i > paintvalue2; i -= 4){
	graphics.setColor(j,j,255);
	if((i - paintvalue2) >= 4)
		graphics.fillRect(10, i, 5, 3);
	else
		graphics.fillRect(10, paintvalue2+3, 5, (i - paintvalue2));
	j -= 8;
	if(j<0)
		j = 0;
}
graphics.setColor(255,255,255);
graphics.fillRect(10, wp2, 5, 1);
j = 150;
for(i = getHeight(); i > paintvalue3; i -= 4){
	graphics.setColor(j,j,255);
	if((i - paintvalue3) >= 4)
		graphics.fillRect(16, i, 5, 3);
	else
		graphics.fillRect(16, paintvalue3+3, 5, (i - paintvalue3));
	j -= 8;
	if(j<0)
		j = 0;
}
graphics.setColor(255,255,255);
graphics.fillRect(16, wp3, 5, 1);
j = 150;
for(i = getHeight(); i > paintvalue4; i -= 4){
	graphics.setColor(j,j,255);
	if((i - paintvalue4) >= 4)
		graphics.fillRect(22, i, 5, 3);
	else
		graphics.fillRect(22, paintvalue4+3, 5, (i - paintvalue4));
	j -= 8;
	if(j<0)
		j = 0;
}
graphics.setColor(255,255,255);
graphics.fillRect(22, wp4, 5, 1);
j = 150;
for(i = getHeight(); i > paintvalue5; i -= 4){
	graphics.setColor(j,j,255);
	if((i - paintvalue5) >= 4)
		graphics.fillRect(28, i, 5, 3);
	else
		graphics.fillRect(28, paintvalue5+3, 5, (i - paintvalue5));
	j -=8;
	if(j<0)
		j = 0;
}
graphics.setColor(255,255,255);
graphics.fillRect(28, wp5, 5, 1);
j = 150;
for(i = getHeight(); i > paintvalue6; i -= 4){
	graphics.setColor(j,j,255);
	if((i - paintvalue6) >= 4)
		graphics.fillRect(34, i, 5, 3);
	else
		graphics.fillRect(34, paintvalue6+3, 5, (i - paintvalue6));
	j -= 8;
	if(j<0)
		j = 0;
}
graphics.setColor(255,255,255);
graphics.fillRect(34, wp6, 5, 1);
j = 150;
for(i = getHeight(); i > paintvalue7; i -= 4){
	graphics.setColor(j,j,255);
	if((i - paintvalue7) >= 4)
		graphics.fillRect(40, i, 5, 3);
	else
		graphics.fillRect(40, paintvalue7+3, 5, (i - paintvalue7));
	j -= 8;
	if(j<0)
		j = 0;
}
graphics.setColor(255,255,255);
graphics.fillRect(40, wp7, 5, 1);
j = 150;
for(i = getHeight(); i > paintvalue8; i -= 4){
	graphics.setColor(j,j,255);
	if((i - paintvalue8) >= 4)
		graphics.fillRect(46, i, 5, 3);
	else
		graphics.fillRect(46, paintvalue8+3, 5, (i - paintvalue8));
	j -= 8;
	if(j<0)
		j = 0;
}
graphics.setColor(255,255,255);
graphics.fillRect(46, wp8, 5, 1);
j = 150;
for(i = getHeight(); i > paintvalue9; i -= 4){
	graphics.setColor(j,j,255);
	if((i - paintvalue9) >= 4)
		graphics.fillRect(52, i, 5, 3);
	else
		graphics.fillRect(52, paintvalue9+3, 5, (i - paintvalue9));
	j -= 8;
	if(j<0)
		j = 0;
}
graphics.setColor(255,255,255);
graphics.fillRect(52, wp9, 5, 1);
j = 150;
for(i = getHeight(); i > paintvalue10; i -= 4){
	graphics.setColor(j,j,255);
	if((i - paintvalue10) >= 4)
		graphics.fillRect(58, i, 5, 3);
	else
		graphics.fillRect(58, paintvalue10+3, 5, (i - paintvalue10));
	j -= 8;
	if(j<0)
		j = 0;
}
graphics.setColor(255,255,255);
graphics.fillRect(58, wp10, 5, 1);
j = 150;
for(i = getHeight(); i > paintvalue11; i -= 4){
	graphics.setColor(j,j,255);
	if((i - paintvalue11) >= 4)
		graphics.fillRect(64, i, 5, 3);
	else
		graphics.fillRect(64, paintvalue11+3, 5, (i - paintvalue11));
	j -= 8;
	if(j<0)
		j = 0;
}
graphics.setColor(255,255,255);
graphics.fillRect(64, wp11, 5, 1);
j = 150;
for(i = getHeight(); i > paintvalue12; i -= 4){
	graphics.setColor(j,j,255);
	if((i - paintvalue12) >= 4)
		graphics.fillRect(70, i, 5, 3);
	else
		graphics.fillRect(70, paintvalue12+3, 5, (i - paintvalue12));
	j -= 8;
	if(j<0)
		j = 0;
}
graphics.setColor(255,255,255);
graphics.fillRect(70, wp12, 5, 1);
j = 150;
for(i = getHeight(); i > paintvalue13; i -= 4){
	graphics.setColor(j,j,255);
	if((i - paintvalue13) >= 4)
		graphics.fillRect(76, i, 5, 3);
	else
		graphics.fillRect(76, paintvalue13+3, 5, (i - paintvalue13));
	j -= 8;
	if(j<0)
		j = 0;
}
graphics.setColor(255,255,255);
graphics.fillRect(76, wp13, 5, 1);
j = 150;
for(i = getHeight(); i > paintvalue14; i -= 4){
	graphics.setColor(j,j,255);
	if((i - paintvalue14) >= 4)
		graphics.fillRect(82, i, 5, 3);
	else
		graphics.fillRect(82, paintvalue14+3, 5, (i - paintvalue14));
	j -= 8;
	if(j<0)
		j = 0;
}
graphics.setColor(255,255,255);
graphics.fillRect(82, wp14, 5, 1);
j = 150;
for(i = getHeight(); i > paintvalue15; i -= 4){
	graphics.setColor(j,j,255);
	if((i - paintvalue15) >= 4)
		graphics.fillRect(88, i, 5, 3);
	else
		graphics.fillRect(88, paintvalue15+3, 5, (i - paintvalue15));
	j -= 8;
	if(j<0)
		j = 0;
}
graphics.setColor(255,255,255);
graphics.fillRect(88, wp15, 5, 1);
j = 150;
for(i = getHeight(); i > paintvalue16; i -= 4){
	graphics.setColor(j,j,255);
	if((i - paintvalue16) >= 4)
		graphics.fillRect(94, i, 5, 3);
	else
		graphics.fillRect(94, paintvalue16+3, 5, (i - paintvalue16));
	j -= 8;
	if(j<0)
		j = 0;
}
graphics.setColor(255,255,255);
graphics.fillRect(94, wp16, 5, 1);
j = 150;
for(i = getHeight(); i > paintvalue17; i -= 4){
	graphics.setColor(j,j,255);
	if((i - paintvalue17) >= 4)
		graphics.fillRect(100, i, 5, 3);
	else
		graphics.fillRect(100, paintvalue17+3, 5, (i - paintvalue17));
	j -= 8;
	if(j<0)
		j = 0;
}
graphics.setColor(255,255,255);
graphics.fillRect(100, wp17, 5, 1);
j = 150;
for(i = getHeight(); i > paintvalue18; i -= 4){
	graphics.setColor(j,j,255);
	if((i - paintvalue18) >= 4)
		graphics.fillRect(106, i, 5, 3);
	else
		graphics.fillRect(106, paintvalue18+3, 5, (i - paintvalue18));
	j -= 8;
	if(j<0)
		j = 0;
}
graphics.setColor(255,255,255);
graphics.fillRect(106, wp18, 5, 1);
j = 150;
for(i = getHeight(); i > paintvalue19; i -= 4){
	graphics.setColor(j,j,255);
	if((i - paintvalue19) >= 4)
		graphics.fillRect(112, i, 5, 3);
	else
		graphics.fillRect(112, paintvalue19+3, 5, (i - paintvalue19));
	j -= 8;
	if(j<0)
		j = 0;
}
graphics.setColor(255,255,255);
graphics.fillRect(112, wp19, 5, 1);
j = 150;
for(i = getHeight(); i > paintvalue20; i -= 4){
	graphics.setColor(j,j,255);
	if((i - paintvalue20) >= 4)
		graphics.fillRect(118, i, 5, 3);
	else
		graphics.fillRect(118, paintvalue20+3, 5, (i - paintvalue20));
	j -= 8;
	if(j<0)
		j = 0;
}
graphics.setColor(255,255,255);
graphics.fillRect(118, wp20, 5, 1);
}

public void run(){
	while(!stop){	
	
		if(paintvalue2 > newvalue2){			
			paintvalue2 = newvalue2;
			if(paintvalue1 > paintvalue2 + 10){				
				newvalue1 = rn.nextInt(30);
				newvalue1 += paintvalue2 -15;				
			}
			if(wp2>= paintvalue2)
				wp2 = paintvalue2 + 1;	
			else
				wp2 += 1;		
			newvalue2 = rn.nextInt(getHeight());				
			while((newvalue2 > (getHeight() - getHeight()/3)) || (newvalue2 < getHeight()/2))
				newvalue2 = rn.nextInt(getHeight());			
		}
		else{
			wp2 += 1;
			paintvalue2 += 2;
					
		}	
		if(newvalue1 < 0)
				newvalue1 = 0;			
		if(paintvalue1 > newvalue1){			
			paintvalue1 = newvalue1;
			if(paintvalue3 > paintvalue1 + 10){				
				newvalue3 = rn.nextInt(30);
				newvalue3 += paintvalue1 -15;				
			}				
			if(wp1>= paintvalue1)
				wp1 = paintvalue1 + 1;
			else
				wp1 += 1;	
			newvalue1 = rn.nextInt(getHeight());
			while(newvalue1 < paintvalue2 - 15)
				newvalue1 = rn.nextInt(getHeight());
		}
		else{								
			wp1 += 1;
			paintvalue1 += 2;		
		}
		if(newvalue3 < 0)
				newvalue3 = 0;	
		if(paintvalue3 > newvalue3){			
			paintvalue3 = newvalue3;
			if(paintvalue4 > paintvalue3 + 10){				
				newvalue4 = rn.nextInt(30);
				newvalue4 += paintvalue3 -15;				
			}
			paintvalue3 = newvalue3;			
			if(wp3>= paintvalue3)
				wp3 = paintvalue3 +1;	
			else
				wp3 += 1;			
			newvalue3 = rn.nextInt(getHeight());
			while(newvalue3 < paintvalue1 - 15)
				newvalue3 = rn.nextInt(getHeight());
		}
		else{
			wp3 += 1;
			paintvalue3 += 2;			
		}
		if(newvalue4 < 0)
				newvalue4 = 0;
		if(paintvalue4 > newvalue4){						
			paintvalue4 = newvalue4;
			if(paintvalue5 > paintvalue4 + 10){				
				newvalue5 = rn.nextInt(30);
				newvalue5 += paintvalue4 -15;				
			}
			if(wp4>= paintvalue4)
				wp4 = paintvalue4 +1;	
			else
				wp4 += 1;
			newvalue4 = rn.nextInt(getHeight());
			while(newvalue4 < paintvalue3 - 15)
				newvalue4 = rn.nextInt(getHeight());
		}
		else{
			wp4 += 1;
			paintvalue4 += 2;			
		}
		if(newvalue5 < 0)
				newvalue5 = 0;
		if(paintvalue5 > newvalue5){			
			paintvalue5 = newvalue5;
			if(paintvalue6 > paintvalue5 + 5){
				newvalue6 = rn.nextInt(30);
				newvalue6 += paintvalue5 - 25;	
			}													
			if(wp5>= paintvalue5)
				wp5 = paintvalue5 +1;	
			else
				wp5 += 1;
			newvalue5 = rn.nextInt(getHeight());
			while(newvalue5 < paintvalue4 - 15)
				newvalue5 = rn.nextInt(getHeight());
		}
		else{
			wp5 += 1;
			paintvalue5 += 2;			
		}
		if(newvalue6 < 0)
				newvalue6 = 0;			
		if(paintvalue6 > newvalue6){												
			paintvalue6 = newvalue6;
			while((newvalue7 > paintvalue6)||(newvalue7 < paintvalue6-20))
					newvalue7 = rn.nextInt(getHeight());						
			if(wp6>= paintvalue6)
				wp6 = paintvalue6 +1;	
			else
				wp6 += 1;	
			newvalue6 = rn.nextInt(getHeight());
			while(newvalue6 < paintvalue5 - 25)
				newvalue6 = rn.nextInt(getHeight());
			
				
		}
		else{
			wp6 += 1;
			paintvalue6 += 2;			
		}
		if(newvalue7 < 0)
				newvalue7 = 0;
		if(paintvalue7 > newvalue7){			
			paintvalue7 = newvalue7;	
			if(paintvalue7 < (getHeight()/3-10))
				while(newvalue8 > paintvalue7)
					newvalue8 = rn.nextInt(getHeight());
			else{
				newvalue8 = rn.nextInt(40);
				newvalue8 = paintvalue7 + 30 - newvalue8;
			}				
			if(wp7>= paintvalue7)
				wp7 = paintvalue7+1;	
			else
				wp7 += 1;
			newvalue7 = rn.nextInt(getHeight());						
			while((newvalue7 > paintvalue6)||(newvalue7 < paintvalue6-20))
				newvalue7 = rn.nextInt(getHeight());
		}
		else{
			wp7 += 1;
			paintvalue7 += 2;				
		}
		if(newvalue8 < 0)
				newvalue8 = 0;
		if(paintvalue8 > newvalue8){			
			paintvalue8 = newvalue8;	
			if(paintvalue6 > paintvalue7)	
				while((newvalue9 > paintvalue6)||(newvalue9 < paintvalue7))
					newvalue9 = rn.nextInt(getHeight());						
			else
				while((newvalue9 < paintvalue6)||(newvalue9 > paintvalue7))
					newvalue9 = rn.nextInt(getHeight());			
			if(wp8>= paintvalue8)
				wp8 = paintvalue8 +1;	
			else
				wp8 += 1;
			newvalue8 = rn.nextInt(getHeight());
			if(paintvalue7 < (getHeight()/3-10))
				while(newvalue8 > paintvalue7)
					newvalue8 = rn.nextInt(getHeight());
			else{
				newvalue8 = rn.nextInt(30);
				newvalue8 = paintvalue7 + 20 - newvalue8;
			}			
		}
		else{
			wp8 += 1;
			paintvalue8 += 2;			
		}	
		if(newvalue9 < 0)
				newvalue9 = 0;	
		if(paintvalue9 > newvalue9){			
			paintvalue9 = newvalue9;
			if(paintvalue10 > paintvalue9)
				while((newvalue10 > paintvalue9 + 30)||((newvalue10 < paintvalue9 - 20)))
					newvalue10 = rn.nextInt(getHeight());
			if(wp9>= paintvalue9)
				wp9 = paintvalue9 +1;	
			else
				wp9 += 1;
			newvalue9 = rn.nextInt(getHeight());
			if(paintvalue6 > paintvalue7)	
				while((newvalue9 > paintvalue6)||(newvalue9 < paintvalue7))
					newvalue9 = rn.nextInt(getHeight());						
			else
				while((newvalue9 < paintvalue6)||(newvalue9 > paintvalue7))
					newvalue9 = rn.nextInt(getHeight());			
		}
		else{
			wp9 += 1;
			paintvalue9 += 2;			
		}
		if(paintvalue10 > newvalue10){
			if(newvalue10 < 0)
				newvalue10 = 0;
			paintvalue10 = newvalue10;
			if(wp10>= paintvalue10)
				wp10= paintvalue10 +1;
			else
				wp10 += 1;	
			newvalue10 = rn.nextInt(getHeight());
			while((newvalue10 > paintvalue9 + 30)||((newvalue10 < paintvalue9 - 20)))
				newvalue10 = rn.nextInt(getHeight());			
		}
		else{
			wp10 += 1;
			paintvalue10 += 2;			
		}
		if(newvalue11 < 0)
				newvalue11 = 0;
		if(paintvalue11 > newvalue11){			
			paintvalue11 = newvalue11;
			if(wp11>= paintvalue11)
				wp11 = paintvalue11 +1;
			else
				wp11 += 1;	
			newvalue11 = rn.nextInt(getHeight());
			while(newvalue11>(getHeight() - (getHeight()/3)))
				newvalue11 = rn.nextInt(getHeight());
		}
		else{
			wp11 += 1;
			paintvalue11 += 2;			
		}
		if(newvalue12 < 0)
				newvalue12 = 0;
		if(paintvalue12 > newvalue12){			
			paintvalue12 = newvalue12;
			if(wp12>= paintvalue12)
				wp12 = paintvalue12 +1;
			else
				wp12 += 1;	
			newvalue12 = rn.nextInt(getHeight());
			while(newvalue12>(getHeight() - (getHeight()/3)))
				newvalue12 = rn.nextInt(getHeight());
		}
		else{
			wp12 += 1;
			paintvalue12 += 2;			
		}
		if(newvalue13 < 0)
				newvalue13 = 0;
		if(paintvalue13 > newvalue13){			
			paintvalue13 = newvalue13;
			if(wp13>= paintvalue13)
				wp13 = paintvalue13 +1;
				wp13 += 1;	
			newvalue13 = rn.nextInt(getHeight());
			while(newvalue13>(getHeight() - (getHeight()/3)))
				newvalue13 = rn.nextInt(getHeight());
		}
		else{
			wp13 += 1;
			paintvalue13 += 2;			
		}
		if(newvalue14 < 0)
				newvalue14 = 0;
		if(paintvalue14 > newvalue14){			
			paintvalue14 = newvalue14;
			if(wp14>= paintvalue14)
				wp14 = paintvalue14 +1;
			else
				wp14 += 1;	
			newvalue14 = rn.nextInt(getHeight());
			while(newvalue14>(getHeight() - (getHeight()/3)))
				newvalue14= rn.nextInt(getHeight());
		}
		else{
			wp14 += 1;
			paintvalue14 += 2;			
		}
		if(newvalue15 < 0)
				newvalue15 = 0;
		if(paintvalue15 > newvalue15){			
			paintvalue15 = newvalue15;
			if(wp15>= paintvalue15)
				wp15 = paintvalue15 +1;
			else
				wp15 += 1;	
			newvalue15 = rn.nextInt(getHeight());
			while(newvalue15>(getHeight() - (getHeight()/3)))
				newvalue15 = rn.nextInt(getHeight());
		}
		else{
			wp15 += 1;
			paintvalue15 += 2;			
		}
		if(newvalue16 < 0)
				newvalue16 = 0;
		if(paintvalue16 > newvalue16){			
			paintvalue16 = newvalue16;
			if(wp16>= paintvalue16)
				wp16 = paintvalue16 +1;
			else
				wp16 += 1;	
			newvalue16 = rn.nextInt(getHeight());
			while(newvalue16>(getHeight() - (getHeight()/3)))
				newvalue16 = rn.nextInt(getHeight());
		}
		else{
			wp16 += 1;
			paintvalue16 += 2;			
		}
		if(newvalue17 < 0)
				newvalue17 = 0;
		if(paintvalue17 > newvalue17){			
			paintvalue17 = newvalue17;
			if(wp17>= paintvalue17)
				wp17 = paintvalue17 +1;
			else
				wp17 += 1;	
			newvalue17 = rn.nextInt(getHeight());
			while(newvalue17>(getHeight() - (getHeight()/3)))
				newvalue17 = rn.nextInt(getHeight());
		}
		else{
			wp17 += 1;
			paintvalue17 += 2;			
		}
		if(paintvalue18 > newvalue18){
			paintvalue18 = newvalue18;
			if(paintvalue19 > paintvalue18 + 10){				
				newvalue19 = rn.nextInt(20);
				newvalue19 += paintvalue18;				
			}
			if(wp18>= paintvalue18)
				wp18 = paintvalue18 +1;
			else
				wp18 += 1;	
			newvalue18 = rn.nextInt(getHeight());
			while((newvalue18 > (getHeight() - (getHeight()/3))) || (newvalue18 < (getHeight()/2)))
				newvalue18 = rn.nextInt(getHeight());
		}
		else{
			wp18 += 1;
			paintvalue18 += 2;			
		}
		if(paintvalue19 > newvalue19){
			paintvalue19 = newvalue19;
			if(paintvalue20 > paintvalue19 + 10){				
				newvalue20 = rn.nextInt(20);
				newvalue20 += paintvalue19;				
			}
			if(wp19>= paintvalue19)
				wp19 = paintvalue19 +1;
			else
				wp19 += 1;	
			newvalue19 = rn.nextInt(getHeight());
			while(newvalue19 < paintvalue18)
				newvalue19 = rn.nextInt(getHeight());
		}
		else{
			wp19 += 1;
			paintvalue19 += 2;			
		}
		if(paintvalue20 > newvalue20){
			paintvalue20 = newvalue20;
			if(wp20>= paintvalue20)
				wp20 = paintvalue20 +1;
			else
				wp20 += 1;	
			newvalue20 = rn.nextInt(getHeight());
			while(newvalue20 < paintvalue19)
				newvalue20 = rn.nextInt(getHeight());
		}
		else{
			wp20 += 1;
			paintvalue20 += 2;			
		}
		try{		
			Thread.sleep(40);
		
		}
		catch(Exception e){}
		repaint();
	}
}
	public void commandAction(Command command, Displayable displayable){
		if (command == exit){
			rectangleExample.exitMIDlet();
		}
	}
}  